In general, an electronic control unit including a microcomputer further includes a monitoring circuit that monitors operation of the microcomputer. When the monitoring circuit determines that the microcomputer has an abnormality, the monitoring circuit outputs a reset signal to the microcomputer so as to correctly recover the microcomputer (see, for example, JP 2008-152678 A corresponding to US 2008/0148107 A1).
The inventor of the present disclosure has considered a microcomputer that has a function of detecting an internal abnormality such as a task omission due to a high processing load and a program counter abnormality, and a function of storing an error code indicating a content of the abnormality in a memory when the internal abnormality is detected and then being reset intentionally. Accordingly, for example, when an abnormality occurs in functions of the electronic control unit, a cause of the abnormality (i.e., a cause of resetting the microcomputer) can be specified by reading out the error code from the memory.
However, some causes resetting the microcomputer, such as a noise mixing to a reset signal line and an abnormality of an oscillator for generating an operation clock of the microcomputer, cannot be recognized by the microcomputer. Thus, in a case where the microcomputer is reset due to a unknown cause, the microcomputer suddenly stops operation without knowing the cause and cannot store the error code. Thus, in the above-described case, the cause of resetting the microcomputer cannot be analyzed.